@extends('layouts.public')

@section('bodyattr')class="gray-bg"@endsection

@section('body')
    <div class="wrapper wrapper-content">
        <div class="row m-b">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="{{route('admin.good.goods')}}">签到列表</a></li>
                        <li><a href="{{route('admin.sign.signs.add')}}">签到规则</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
                            <thead>
                            <tr role="row">
                                <th>签到ID</th>
                                <th>用户</th>
                                <th>签到积分</th>
                                <th class="sorting" orderby="created_at">签到时间</th>


                            </tr>
                            </thead>
                            @foreach($signs as $user)
                                <tr class="gradeA">
                                    <td>{{$user['id']}}</td>
                                    <td>{{$user['username']}}</td>
                                    <td>{{$user['scores']}}</td>
                                    <td>{{$user['created_at']}}</td>
                                </tr>
                            @endforeach
                        </table>
                        <div class="row">
                            <div class="col-sm-12">
                                <div>共 {{ $signs->total() }} 条记录</div>
                                {!! $signs->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('script')
    <script type="text/javascript" src="{{cdn('js/plugins/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        laydate.render({
            elem: '#created_at',
            range: true,
            max: 0
        });
    </script>
@endsection
